<?php $memAccount = $this->Session->read('member_account'); ?>



<div class='m-t col-lg-12 b-b'>
    <h4 class='font-bold text-info'>Edit Your Profile</h4>
    <p>Edit your profile information below. Information you profile here goes directly to the organisations you connect to help them with their internal data management.</p>
</div>

<div class="wrapper">
    <?php $orgAccount = $this->Session->read('org_account'); ?>
    <style>
        #profile-form tbody th {
            text-align: right;
        }

        #profile-image {
            padding: 10px;
            border: solid #ddd 1px;
            width: 150px;
            height: 170px;
            margin: 5px auto;
            background-size: cover;
            background-position: center;
        }

        .panel-heading .accordion-toggle {
            display: block;
        }
    </style>

    <form action="<?php echo $this->Html->url(array('controller' => 'organisation', 'action' => 'addMember')); ?>" method ="post" id="profile-form" class="form-horizontal" style="margin-top: 5px;">

        <div class="panel-group" id="accordionEditor">
            <div class="panel">
                <div class="panel-heading">
                    <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordionEditor" href="#editor_start">
                        <i class="fa fa-user"></i> Basic Information
                    </a>
                </div>
                <div id="editor_start" class="panel-collapse collapse in">
                    <div class="panel-body text-sm">

                        <div class="col-lg-6">
                            <div class="form-group">
                                <div class="col-md-5 control-label">Title: </div>
                                <div class="col-md-7 controls">
                                    <select name="Member[title]" class="form-control input-sm input-s-sm"> 
                                        <?php
                                        $titles = array('' => 'Select', 'mr' => 'Mr.', 'mrs' => 'Mrs.', 'ms' => 'Ms.', 'dr' => 'Dr.', 'prof' => 'Prof.', 'prof_dr' => 'Prof. Dr.', 'rev' => 'Rev.', 'rev_dr' => 'Rev. Dr.');

                                        foreach ($titles as $key => $value) {
                                            $selected = isset($member) && $member['Member']['title'] == $key ? 'selected' : '';
                                            echo "<option value='$key' $selected>$value</option>";
                                        }
                                        ?>
                                    </select>

                                    <input type="hidden" name="Member[id]" id="member_id" value="<?php echo isset($member) ? $member['Member']['id'] : ''; ?>" />
                                </div>
                            </div>

                            <div class='form-group'>
                                <div class='col-md-5 control-label'>* First Name: </div>
                                <div class='col-md-7 controls'>
                                    <input type ="text" name="Member[first_name]" placeholder="First Name" id="first_name" required="" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['first_name'] : ''; ?>" />

                                </div>
                            </div>

                            <div class='form-group'>
                                <div class="col-md-5 control-label">Middle Name: </div>
                                <div class='col-md-7 controls'>
                                    <input type ="text" name="Member[middle_name]" placeholder="Middle Name" id="middle_name" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['middle_name'] : ''; ?>" />
                                </div>
                            </div>

                            <div class='form-group'>
                                <div class='col-md-5 control-label'>* Last Name: </div>
                                <div class='col-md-7 controls'>
                                    <input type ="text" name="Member[last_name]" placeholder="Last Name" id="last_name" required="" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['last_name'] : ''; ?>" />
                                </div>
                            </div>
                            
                            <div class='form-group'>
                                <div class='col-md-5 control-label'>Maiden Name: </div>
                                <div class='col-md-7 controls'>
                                    <input type ="text" name="Member[maiden_name]" placeholder="Maiden Name" id="maiden_name" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['maiden_name'] : ''; ?>" />
                                </div>
                            </div>

                            <div class='form-group'>
                                <div class='col-md-5 control-label'>Date Of Birth:</div>
                                <div class='col-md-7 controls'>
                                    <input type="text" name="Member[dob]" id="birthday" class="form-control input-sm datepicker-input" data-date-format="yyyy-mm-dd" value="<?php echo isset($member) ? $member['Member']['dob'] : ''; ?>" />
                                </div>

                            </div>

                            <div class='form-group'>
                                <div class="col-md-5 control-label">Marital Status:</div>
                                <div class="col-md-7 controls">
                                    <select name="Member[marital_status]" class="form-control input-sm input-s-sm">
                                        <?php
                                        $titles = array('' => 'Select', 'single' => 'Single', 'married' => 'Married',
                                            'separated' => 'Separated', 'divorced' => 'Divorced', 'cohabiting' => 'Cohabiting', 'widowed' => 'Widowed');

                                        foreach ($titles as $key => $value) {
                                            $selected = isset($member) && $member['Member']['marital_status'] == $key ? 'selected' : '';
                                            echo "<option value='$key' $selected>$value</option>";
                                        }
                                        ?>
                                    </select>
                                </div>
                            </div>

                            <div class='form-group'>
                                <div class='col-md-5 control-label'>* Gender:</div>
                                <div class="col-md-7 controls">
                                    <select name="Member[gender]" class="form-control input-sm input-s-sm" required="">
                                        <?php
                                        $titles = array('' => 'Select', 'male' => 'Male', 'female' => 'Female');

                                        foreach ($titles as $key => $value) {
                                            $selected = isset($member) && $member['Member']['gender'] == $key ? 'selected' : '';
                                            echo "<option value='$key' $selected>$value</option>";
                                        }
                                        ?>
                                    </select>
                                </div>
                            </div>

                        </div>

                        <div class="col-lg-6">

                            <div class='form-group'>
                                <div class='col-md-5 control-label'>Mobile Number:</div>
                                <div class='col-md-7 controls'><input type="text" name="Member[mobile_number]" id="number" class="form-control input-sm input-sm-s" value="<?php echo isset($member) ? $member['Member']['mobile_number'] : ''; ?>"/></div>
                            </div>

                            <div class='form-group'>
                                <div class='col-md-5 control-label'>Office Number:</div>
                                <div class='col-md-7 controls'><input type="text" name="Member[office_number]" id="number" class="form-control input-sm input-sm-s" value="<?php echo isset($member) ? $member['Member']['office_number'] : ''; ?>" /></div>
                            </div>

                            <div class='form-group'>
                                <div class='col-md-5 control-label'>Email Address: </div>
                                <div class="col-md-7 controls"><input type="email" name="Member[email]" id="number" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['email'] : ''; ?>" /></div>
                            </div>
                            <div class='form-group'>
                                <div class='col-md-5 control-label'>Postal Address: </div>
                                <div class="col-md-7 controls"><input type="text" name="Member[address]" id="post_add" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['address'] : ''; ?>" /></div>
                            </div>
                            <div class='form-group'>
                                <div class='col-md-5 control-label'>Website: </div>
                                <div class="col-md-7 controls"><input type="url" name="Member[website]" id="post_add" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['website'] : ''; ?>" /></div>
                            </div>
                            <!--<tr>
                                <td>Social Profiles:</td>
                                <td colspan="3">
                                    <label class="label label-info" style="display: inline">Facebook</label>
                                    <label class="label label-info" style="display: inline">Twitter</label>
                                </td>
                            </tr>-->

                        </div>

                    </div>
                </div>
            </div>

            <div class="panel" id="extra_profile_info">
                <div class="panel-heading">
                    <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordionEditor" href="#photos">
                        <i class="fa fa-picture-o"></i> Photos
                    </a>
                </div>
                <div id="photos" class="panel-collapse collapse">
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-6">
                                <h4 class="text-info">Your Profile Photos</h4>
                            </div>
                            <div class="col-lg-6 text-right">
                                <button class="btn btn-sm btn-default btn-rounded" id="upload-btn"><i class="fa fa-cloud-upload"></i> Upload New</button>
                            </div>
                        </div>

                        <div class="col-lg-3 text-sm">


                            <p>You can upload up to six (6) profile photos and change them as when you like.</p>
                            <p>
                                You can then choose which photograph best represents you for each organisation you 
                                connect with.
                            </p>
                            <p>
                                You can also set the <b class="text-info">default</b> photo to use with any organisation
                                until you explicitly change it.
                            </p>
                        </div>
                        <div class="col-lg-9">

                            <?php for ($i = 0; $i < 6; $i++) { ?>
                                <div class="col-lg-4 col-sm-4 col-md-4">
                                    <div id="profile-image" style="<?php echo isset($src) ? "background-image: url($src);" : ''; ?>">
                                        <input type="hidden" name="Member[MemberImage][0][id]" id="image_id" value="<?php echo isset($member['OrganisationMemberImage']['member_image_id']) ? $member['OrganisationMemberImage']['member_image_id'] : ''; ?>" />
                                    </div>
                                </div>
                            <?php } ?>
                        </div>
                    </div>
                </div>
            </div>

            <div class="panel" id="extra_profile_info">
                <div class="panel-heading">
                    <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordionEditor" href="#editor_profile_extra">
                        <i class="fa fa-plus"></i> Additional Information
                    </a>
                </div>
                <div id="editor_profile_extra" class="panel-collapse collapse">
                    <div class="panel-body">
                        <div class="col-lg-6">
                            <div class="form-group">
                                <div class="col-md-5 control-label">Place of Birth:</div>
                                <div class="col-md-7 controls">
                                    <input type="text" name="Member[place_of_birth]" id="pob" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['place_of_birth'] : ''; ?>" />
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-md-5 control-label">Hometown:</div>
                                <div class="col-md-7 controls">
                                    <input type="text" name="Member[home_town]" id="hometown" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['home_town'] : ''; ?>" />
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-md-5 control-label">Tribe:</div>
                                <div class="col-md-7 controls">
                                    <input type="text" name="Member[tribe]" id="tribe" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['tribe'] : ''; ?>" />
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-md-5 control-label">Nationality:</div>
                                <div class="col-md-7 controls">
                                    <input type="text" name="Member[nationality]" id="nationality" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['nationality'] : ''; ?>" />
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-md-5 control-label">Employment Status:</div>
                                <div class="col-md-7 controls">
                                    <select name="Member[employment_status]" class="form-control input-sm">
                                        <?php
                                        $titles = array('' => 'Select', 'employer' => 'Employer', 'employed' => 'Employed', 'unemployed' => 'Unemployed');

                                        foreach ($titles as $key => $value) {
                                            $selected = isset($member) && strtolower($member['Member']['employment_status']) == $key ? 'selected' : '';
                                            echo "<option value='$key' $selected>$value</option>";
                                        }
                                        ?>
                                    </select>
                                </div>

                            </div>
                        </div>

                        <div class="col-lg-6">
                            <div class="form-group">
                                <div class="col-md-5 control-label">Educational Background:</div>
                                <div class="col-md-7 controls">
                                    <input type="text" name="Member[educational_bg]" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['educational_bg'] : ''; ?>" />
                                    <!--<select name="Member[educational_bg]" class="form-control input-sm">
                                    <?php
                                    $titles = array('' => 'Select', 'Junior High' => 'Junior High', 'Senior High' => 'Senior High', 'Diploma' => 'Diploma',
                                        'Polytechnic' => 'Polytechnic', 'Training College' => 'Training College', 'University (1st Degree)' => 'University (1st Degree)',
                                        'Masters Degree' => 'Masters Degree', 'Doctorate' => 'Doctorate', 'Professorate' => 'Professorate');

                                    foreach ($titles as $key => $value) {
                                        $selected = isset($member) && $member['Member']['educational_bg'] == $key ? 'selected' : '';
                                        echo "<option value='$key' $selected>$value</option>";
                                    }
                                    ?>
                                    </select>-->
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-md-5 control-label">Field of Study:</div>
                                <div class="col-md-7 controls">
                                    <input type="text" name="Member[field_of_study]" id="fos" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['field_of_study'] : ''; ?>" />
                                </div>
                            </div>


                            <div class="form-group">
                                <div class="col-md-5 control-label">Profession:</div>
                                <div class="col-md-7 controls">
                                    <input type="text" name="Member[profession]" id="profession" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['profession'] : ''; ?>"/>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-md-5 control-label">Occupation:</div>
                                <div class="col-md-7 controls">
                                    <input type="text" name="Member[occupation]" id="occupation" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['occupation'] : ''; ?>"/>
                                </div>
                            </div>


                            <div class="form-group">
                                <div class="col-md-5 control-label">Position:</div>
                                <div class="col-md-7 controls">
                                    <input type="text" name="Member[position]" id="position" class="form-control input-sm" value="<?php echo isset($member) ? $member['Member']['position'] : ''; ?>" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="panel">
                <div class="panel-heading">
                    <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordionEditor" href="#family_info">
                        <i class="fa fa-group"></i> Family Information
                    </a>
                </div>
                <div id="family_info" class="panel-collapse collapse">
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="control-label col-lg-1">
                                Father:
                            </div>
                            <div class="controls form-inline col-lg-11">
                                <?php
                                $father = isset($member) && isset($member['Member']['MemberParent'][0]) ? $member['Member']['MemberParent'][0] : null;
                                ?>
                                <input type="text" class="form-control input-sm input-s" placeholder="Father's Name" name="Member[MemberParent][0][name]" value="<?php echo isset($father) ? $father['name'] : ''; ?>" />
                                <input type='text' class='form-control input-sm input-s-sm datepicker-input' data-date-format="yyyy-mm-dd" placeholder="Birth Date" name="Member[MemberParent][0][dob]" value="<?php echo isset($father) ? $father['dob'] : ''; ?>" />
                                <label class="input-s-sm"></label>
                                <label class='input-sm input-s text-xs'>
                                    <input type='hidden' name='Member[MemberParent][0][is_alive]' value='1' />
                                    <input type='checkbox' name='Member[MemberParent][0][is_alive]' value='0' <?php echo isset($father) && $father['is_alive'] == '0' ? 'checked' : ''; ?> />
                                    <span>Deceased</span>
                                </label>

                                <input type='hidden' name='Member[MemberParent][0][member_id]' value='<?php echo isset($member) ? $member['Member']['id'] : ''; ?>' />
                                <input type='hidden' name='Member[MemberParent][0][id]' value='<?php echo isset($father) ? $father['id'] : ''; ?>' />
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="control-label col-lg-1">
                                Mother:
                            </div>
                            <div class="controls form-inline col-lg-11">
                                <?php
                                $mother = isset($member) && isset($member['Member']['MemberParent'][1]) ? $member['Member']['MemberParent'][1] : null;
                                ?>
                                <input type="text" class="form-control input-sm input-s" placeholder="Mother's Name" name="Member[MemberParent][1][name]" value="<?php echo isset($mother) ? $mother['name'] : ''; ?>" />
                                <input type='text' class='form-control input-sm input-s-sm datepicker-input' data-date-format="yyyy-mm-dd" placeholder="Birth Date" name="Member[MemberParent][1][dob]" value="<?php echo isset($mother) ? $mother['dob'] : ''; ?>" />
                                <label class="input-s-sm"></label>
                                <label class='input-sm input-s text-xs'>
                                    <input type='hidden' name='Member[MemberParent][1][is_alive]' value='1' />
                                    <input type='checkbox' name='Member[MemberParent][1][is_alive]' value='0' <?php echo isset($mother) && $mother['is_alive'] == '0' ? 'checked' : ''; ?> />
                                    <span>Deceased</span>
                                </label>

                                <input type='hidden' name='Member[MemberParent][1][member_id]' value='<?php echo isset($member) ? $member['Member']['id'] : ''; ?>' />
                                <input type='hidden' name='Member[MemberParent][1][id]' value='<?php echo isset($mother) ? $mother['id'] : ''; ?>' />
                            </div>
                        </div>

                        <div class="form-group">
                            <?php
                            $spouse = isset($member) && isset($member['Member']['MemberSpouse'][0]) ? $member['Member']['MemberSpouse'][0] : null;
                            ?>
                            <div class="control-label col-lg-1">
                                Spouse:
                            </div>
                            <div class="controls form-inline col-lg-11">
                                <input type="text" class="form-control input-sm input-s" placeholder="Spouse's Name" name="Member[MemberSpouse][0][name]" value="<?php echo isset($spouse) ? $spouse['name'] : ''; ?>" />
                                <input type='text' class='form-control input-sm input-s-sm datepicker-input' data-date-format="yyyy-mm-dd" placeholder="Birth Date" name="Member[MemberSpouse][0][dob]" value="<?php echo isset($spouse) ? $spouse['dob'] : ''; ?>" />
                                <select name="Member[MemberSpouse][0][gender]" class="form-control input-sm input-s-sm">
                                    <option value="">Gender</option>
                                    <option value="male" <?php echo isset($spouse) && $spouse['gender'] == 'male' ? 'selected' : ''; ?>>Male</option>
                                    <option value="female" <?php echo isset($spouse) && $spouse['gender'] == 'female' ? 'selected' : ''; ?>>Female</option>
                                </select>
                                <label class='input-sm input-s text-xs'>
                                    <input type='hidden' name='Member[MemberSpouse][0][is_alive]' value='1' />
                                    <input type='checkbox' name='Member[MemberSpouse][0][is_alive]' value='0' <?php echo isset($spouse) && $spouse['is_alive'] == '0' ? 'checked' : ''; ?> />
                                    <span>Deceased</span>
                                </label>

                                <input type='hidden' name='Member[MemberSpouse][0][member_id]' value='<?php echo isset($member) ? $member['Member']['id'] : ''; ?>' />
                                <input type='hidden' name='Member[MemberSpouse][0][id]' value='<?php echo isset($spouse) ? $spouse['id'] : ''; ?>' />
                            </div>
                        </div>

                        <div class="form-group m-t-lg">
                            <div class="control-label col-lg-1">
                                Children:
                            </div>
                            <div class="controls form-inline col-lg-11">

                                <div class='row'>
                                    <div id='children_block' class='col-lg-10'>
                                        <?php
                                        if (isset($member['Member']['MemberChild'][0])) {
                                            $i = 0;
                                            foreach ($member['Member']['MemberChild'] as $child) {
                                                ?>
                                                <div class='child_block'>
                                                    <input type="text" class="form-control input-sm input-s" placeholder="Child's Name" name='Member[MemberChild][<?php echo $i; ?>]' value='<?php echo $child['name']; ?>' />
                                                    <input type='text' class='form-control input-sm input-s-sm datepicker-input' data-date-format="yyyy-mm-dd" placeholder="Birth Date" name='Member[MemberChild][<?php echo $i; ?>][dob]' value='<?php echo $child['dob']; ?>' />
                                                    <select class="form-control input-sm input-s-sm" name='Member[MemberChild][<?php echo $i; ?>][gender]'>
                                                        <option value="">Gender</option>
                                                        <option value="male" <?php echo $child['gender'] == 'male' ? 'selected' : ''; ?>>Male</option>
                                                        <option value="female" <?php echo $child['gender'] == 'female' ? 'selected' : ''; ?>>Female</option>
                                                    </select>
                                                    <label class='input-sm text-xs'>
                                                        <input type='hidden' name='Member[MemberChild][<?php echo $i; ?>][is_alive]' value='1' />
                                                        <input type='checkbox' name='Member[MemberChild][<?php echo $i; ?>][is_alive]' value='0' <?php echo $child['is_alive'] == '0' ? 'checked' : null; ?> />
                                                        <span>Deceased</span>
                                                    </label>

                                                    <button type='button' class='btn btn-xs btn-danger remove_child'>
                                                        <i class='fa fa-times'></i>
                                                    </button>

                                                    <input type='hidden' name='Member[MemberChild][<?php echo $i; ?>][member_id]' value='<?php echo $child['member_id']; ?>' />
                                                    <input type='hidden' name='Member[MemberChild][<?php echo $i; ?>][id]' class='child_id' value='<?php echo $child['id']; ?>' />
                                                </div>
                                                <?php
                                                $i++;
                                            }
                                        } else {
                                            ?>

                                            <div class='child_block'>
                                                <input type="text" class="form-control input-sm input-s" placeholder="Child's Name" name='Member[MemberChild][0][name]' />
                                                <input type='text' class='form-control input-sm input-s-sm datepicker-input' data-date-format="yyyy-mm-dd" placeholder="Birth Date" name='Member[MemberChild][0][dob]' />
                                                <select class="form-control input-sm input-s-sm" name='Member[MemberChild][0][gender]'>
                                                    <option value="">Gender</option>
                                                    <option value="male">Male</option>
                                                    <option value="female">Female</option>
                                                </select>
                                                <label class='input-sm text-xs'>
                                                    <input type='hidden' name='Member[MemberChild][0][is_alive]' value='1' />
                                                    <input type='checkbox' name='Member[MemberChild][0][is_alive]' value='0' />
                                                    <span>Deceased</span>
                                                </label>

                                                <button type='button' class='btn btn-xs btn-danger remove_child'>
                                                    <i class='fa fa-times'></i>
                                                </button>

                                                <input type='hidden' name='Member[MemberChild][0][member_id]' value='<?php echo isset($member) ? $member['Member']['id'] : ''; ?>' />
                                                <input type='hidden' name='Member[MemberChild][0][id]' class='child_id' value='' />
                                            </div>
                                        <?php } ?>
                                    </div>

                                    <div class='child_options col-lg-2'>
                                        <button type='button' class='btn btn-white btn-sm' id='add_child_btn'>
                                            <i class="fa fa-plus"></i> Add Child
                                        </button>

                                        <input type='hidden' id='remove_child_url' value='<?php echo $this->Html->url(array('action' => 'remove_child')); ?>' />
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>

            <div class="panel" id="location_info">
                <div class="panel-heading">
                    <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordionEditor" href="#editor_two">
                        <i class="fa fa-home"></i> Location Information
                    </a>
                </div>
                <div id="editor_two" class="panel-collapse collapse">
                    <div class="panel-body">
                        <div class="col-lg-6">
                            <h6 class="font-bold text-info">Business Address</h6>

                            <div class="form-group">
                                <div class="col-lg-4 control-label">Address:</div>
                                <div class="col-lg-8 controls">
                                    <input type="text" class="form-control input-sm" name="Member[business_address]" id="bus_add" value="<?php echo isset($member) ? $member['Member']['business_address'] : ''; ?>" />
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-lg-4 control-label">Region / State:</div>
                                <div class="col-lg-8 controls">
                                    <input type="text" name="Member[business_region]" id="region" class="form-control input-sm-s" value="<?php echo isset($member) ? $member['Member']['business_region'] : ''; ?>" />
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-lg-4 control-label">City:</div>
                                <div class="col-lg-8 controls">
                                    <input type="text" name="Member[business_city]" class="form-control input-sm" id="city" value="<?php echo isset($member) ? $member['Member']['business_city'] : ''; ?>" />
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <div class="col-lg-4 control-label">District:</div>
                                <div class="col-lg-8 controls">
                                    <input type="text" name="Member[business_district]" id="district" class="form-control input-sm-s" value="<?php echo isset($member) ? $member['Member']['business_district'] : ''; ?>" />
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-lg-4 control-label">Zip / Post Code:</div>
                                <div class="col-lg-8 controls">
                                    <input type="text" name="Member[business_zip_code]" class="form-control input-sm input-s-xs" maxlength="5" value="<?php echo isset($member) ? $member['Member']['business_zip_code'] : ''; ?>" />
                                </div>
                            </div>
                        </div>

                        <div class="col-lg-6">
                            <h6 class="font-bold text-info">Residential Address</h6>

                            <div class="form-group">
                                <div class="col-lg-4 control-label">Address:</div>
                                <div class="col-lg-8 controls">
                                    <input type="text" class="form-control input-sm" name="Member[residential_address]" id="res_add" value="<?php echo isset($member) ? $member['Member']['residential_address'] : ''; ?>" />
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-lg-4 control-label">Region / State:</div>
                                <div class="col-lg-8 controls">
                                    <input type="text" name="Member[residential_region]" id="region" class="form-control input-sm-s" value="<?php echo isset($member) ? $member['Member']['residential_region'] : ''; ?>" />
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-lg-4 control-label">City:</div>
                                <div class="col-lg-8 controls">
                                    <input type="text" name="Member[residential_city]" class="form-control input-sm" id="city" value="<?php echo isset($member) ? $member['Member']['residential_city'] : ''; ?>" />
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <div class="col-lg-4 control-label">District:</div>
                                <div class="col-lg-8 controls">
                                    <input type="text" name="Member[residential_district]" id="district" class="form-control input-sm-s" value="<?php echo isset($member) ? $member['Member']['residential_district'] : ''; ?>" />
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-lg-4 control-label">Zip / Post Code:</div>
                                <div class="col-lg-8 controls">
                                    <input type="text" name="Member[residential_zip_code]" class="form-control input-sm input-s-xs" maxlength="5" id="zip_code" value="<?php echo isset($member) ? $member['Member']['residential_zip_code'] : ''; ?>" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="form-actions" style="padding-top: 10px; padding-bottom: 10px; padding-left: 110px;">
            <button type="submit" class="btn btn-info btn-sm" id="submit-btn"><i class="fa fa-save"></i> Save Changes</button>
            <button type="button" class="btn btn-white btn-sm" id="cancel-btn"><i class="fa fa-remove"></i> Cancel</button>
        </div>
    </form>
</div>

<input type='hidden' id='dashboard_url' value='<?php echo $this->Html->url('/member'); ?>' />

<?php echo $this->Html->script('app/views/members/profile.js'); ?>
